package com.springx.examples.showcase.common.domain;

import com.springx.modules.persistence.SearchFilter;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by roman_000 on 2015/9/28.
 */
public class Condition extends HashMap<String, Object> {

    /**
     * 等于
     */
    public static String EQ = "EQ";

    /**
     * 不等于
     */
    public static String NE = "NE";

    /**
     * 大于
     */
    public static String GT = "GT";

    /**
     * 小于
     */
    public static String LT = "LT";

    /**
     * 大于等于
     */
    public static String GTE = "GTE";

    /**
     * 小于等于
     */
    public static String LTE = "LTE";

    /**
     * 相似
     */
    public static String LIKE = "LIKE";

    /**
     * 包含
     */
    public static String IN = "IN";

    /**
     * 为NULL
     */
    public static String NULL = "NULL";

    /**
     * 不为NULL
     */
    public static String NOTNULL = "NOTNULL";

   /* public String fieldName;
    public Object value;
    public String operator;*/

    public void put(String fieldName, String operator, Object value) {

        this.put(operator + "_" + fieldName, value);
    }

    public void remove(String fieldName, String operator) {
        this.remove(operator + "_" + fieldName);
    }

    public void clear() {
        this.clear();
    }
}
